<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/18
  Time: 10:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登记出库查询明细</title>
</head>
<body>
        <div class="modal-header">
            <button class="close" data-dismiss="modal">退出</button>
        </div>
        <div class="modal-content">
            <div class="row">
                <div class="col-md-offset-5"><h2><strong>出库单明细</strong></h2></div>
            </div>
            <br>
            <div class="row">
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>出库单号:</td>
                            <td><input type="text" id="outpayidshow" readonly style="outline: none;border: none"></td>
                        </tr>
                        <tr>
                            <td>产品名称:</td>
                            <td><input type="text" id="productNameout" readonly style="outline: none;border: none"></td>
                        </tr>
                    </table>
                </div>
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>产品编号:</td>
                            <td><input type="text" id="productIdoust" readonly style="outline: none;border: none"></td>
                        </tr>
                        <tr>
                            <td>成本价:</td>
                            <td><input type="text" id="costPriceout" readonly style="outline: none;border: none"></td>
                        </tr>
                    </table>
                </div>
            </div>
            <br>
            <div>
                <table id="outpeyshowalltabmodaltab">

                </table>
            </div>
        </div>
        <script>
            //加载数据
            $(function () {
                $("#outpeyshowalltabmodaltab").bootstrapTable({
                    sortable: true,//是否显示排序
                    sortOrder: "aso",//排序方式
                    sidePagination:"server", //分页方式：client客户端分页，server服务端分页（*）
                    showColumns: true,//是否显示所有的列（选择显示的列）
                    showRefresh: true,//是否显示刷新按钮
                    minimumCountColumns: 2,//最少允许的列数
                    showToggle: true,//是否显示详细视图和列表视图的切换按钮
                    cardView: false,//是否显示详细视图
                    detailView: false,//是否显示父子表,
                    columns:[
                        {
                            field:"",
                            title:"序号",
                            formatter:function (value,row,index) {
                                return Number(index)+1
                            }
                        },
                        {
                            field:"tie",
                            title:"出库时间",
                        },
                        {
                            field:"amount",
                            title:"本次入库数量",
                        },
                        {
                            field:"subtotal",
                            title:"本次入库成本",
                        }

                    ]
                })
                //获取值
                var id='${param.id}'
                var payId='${param.payId}'
                var productId='${param.productId}'
                var tie='${param.tie}'
                $.post("queryBypayDetalisByid.action",{"id":id,"productId":productId},function (data) {
                    //赋值
                    //出库编号
                    $("#outpayidshow").val(payId)
                    //产品名称
                    $("#productNameout").val(data.productName)
                    //产品编号
                    $("#productIdoust").val(data.productId)
                    //单价
                    $("#costPriceout").val(data.amountUnit)

                    //加载表格数据
                    var arr={
                        tie:tie,
                        amount:data.amount,
                        subtotal:data.subtotal,
                    }
                    $("#outpeyshowalltabmodaltab").bootstrapTable("append",arr);

                },"json")
            })
        </script>
</body>
</html>
